#include "junix.h"
#include <boost/lambda/lambda.hpp>
#include <boost/ref.hpp>
#include <boost/lambda/bind.hpp>

using namespace std;

size_t total_size(const list<string>& strings)
{
  size_t total = 0;
  for_each(
    strings.begin(),
    strings.end(),
    boost::ref(total) +=
      boost::lambda::bind(&string::size, boost::lambda::_1));
  return total;
}

int main()
{
	std::list<std::string> strings;
	strings.push_back(std::string("hello"));
	strings.push_back(std::string("junix"));

	std::cout<<total_size(strings)<<std::endl;
}
